package com.jspx.txweb.table;

import com.jspx.json.NotExpose;
import com.jspx.sober.annotation.Column;
import com.jspx.sober.annotation.IDType;
import com.jspx.sober.annotation.Id;
import com.jspx.sober.annotation.Table;
import com.jspx.sober.table.OperateTable;
import com.jspx.utils.StringUtil;

import java.util.Date;

/**
 * 这里是第三方开放接口审核表
 */
@Table(name = "jspx_connect_app", caption = "应用授权", cache = true)
public class ConnectApp extends OperateTable {

    @Id(auto = true, type = IDType.serial)
    @Column(caption = "ID", notNull = true)
    private long id;

    //审核通过后获得,审核通过后自动生成,配合公密完成加密传输，验证
    @Column(caption = "私秘", length = 33, hidden = true, notNull = true)
    private String secret = StringUtil.empty;

    //根据公司名称来
    @NotExpose
    @Column(caption = "拼音", length = 100, hidden = true, notNull = true)
    private String spelling = StringUtil.empty;

    @Column(caption = "关键字", length = 240, dataType = "isLengthBetween(2,240)", notNull = true)
    private String tags = StringUtil.empty;

    @Column(caption = "应用名称", length = 100, dataType = "isLengthBetween(2,240)", notNull = true)
    private String title = StringUtil.empty;

    @Column(caption = "应用类型", hidden = true, option = "0:个人;1:公司;2:开发商", notNull = true)
    private int appType = 0;

    @Column(caption = "公司", length = 200, dataType = "isLengthBetween(2,200)", notNull = false)
    private String company = StringUtil.empty;

    //附件列表
    @Column(caption = "附件", length = 1200, dataType = "isLengthBetween(0,200)")
    private String attachments = StringUtil.empty;

    @NotExpose
    @Column(caption = "排序时间", notNull = true)
    private Date sortDate = new Date();

    @Column(caption = "排序", notNull = false)
    private int sortType = 0;

    @Column(caption = "调用次数", notNull = true, defaultValue = "0")
    private int click = 0;

    @Column(caption = "是否审核", length = 2, notNull = true, defaultValue = "0")
    private int auditingType = 0;

    @Column(caption = "审核时间", notNull = true)
    private Date auditingDate = new Date();

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getSecret() {
        return secret;
    }

    public void setSecret(String secret) {
        this.secret = secret;
    }

    public String getSpelling() {
        return spelling;
    }

    public void setSpelling(String spelling) {
        this.spelling = spelling;
    }

    public String getTags() {
        return tags;
    }

    public void setTags(String tags) {
        this.tags = tags;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public int getAppType() {
        return appType;
    }

    public void setAppType(int appType) {
        this.appType = appType;
    }

    public String getCompany() {
        return company;
    }

    public void setCompany(String company) {
        this.company = company;
    }

    public String getAttachments() {
        return attachments;
    }

    public void setAttachments(String attachments) {
        this.attachments = attachments;
    }

    public Date getSortDate() {
        return sortDate;
    }

    public void setSortDate(Date sortDate) {
        this.sortDate = sortDate;
    }

    public int getClick() {
        return click;
    }

    public void setClick(int click) {
        this.click = click;
    }

    public int getAuditingType() {
        return auditingType;
    }

    public void setAuditingType(int auditingType) {
        this.auditingType = auditingType;
    }

    public Date getAuditingDate() {
        return auditingDate;
    }

    public void setAuditingDate(Date auditingDate) {
        this.auditingDate = auditingDate;
    }

    public int getSortType() {
        return sortType;
    }

    public void setSortType(int sortType) {
        this.sortType = sortType;
    }
}